# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-persistent
pkgver=5.0
pkgrel=1
pkgdesc="Translucent persistent objects"
arch=('loong64' 'x86_64')
license=('ZPL')
url="https://github.com/zopefoundation/persistent/"
depends=('python-cffi' 'python-zope-interface')
makedepends=('python-setuptools')
checkdepends=('python-zope-testrunner' 'python-manuel')
source=("https://github.com/zopefoundation/persistent/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('561c339574817f70d1e5b091d77e3cd7a876a49742938591cfffdf4ec5a6ae23b4a7b4e7ff7d90d15763ce9485c093ff019699364952974e9ffe4da88bcf293f')

build() {
  cd persistent-$pkgver
  python setup.py build
}

check() {
  cd persistent-$pkgver
  python -m venv "$srcdir/pyvenv" --system-site-packages
  (
    . "$srcdir/pyvenv/bin/activate"
    python setup.py develop
    python -m zope.testrunner --test-path=src
  )
}

package() {
  cd persistent-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
